package com.platform.api;

import com.platform.annotation.IgnoreAuth;
import com.platform.dao.ApiTbCategoryMapper;
import com.platform.entity.TbCategoryVo;
import com.platform.entity.TbGoodsSpeVo;
import com.platform.util.ApiBaseAction;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "test-商品类型接口")
@RestController
@RequestMapping("/api/tbCategory")
public class ApiTbCategoryController extends ApiBaseAction {

    @Autowired
    ApiTbCategoryMapper apiTbCategoryMapper;

    @ApiOperation(value = "商品类型列表")
    @IgnoreAuth
    @PostMapping("list")
    public Object list(@ApiParam("是否展示") @RequestParam(value = "isOpen",required = false) Integer isOpen) {
        List<TbCategoryVo> list = apiTbCategoryMapper.queryList(isOpen);
        return toResponsSuccess(list);
    }
}
